using System;
using UnityEngine;

[Serializable]
public class cross : MonoBehaviour
{
	public AudioClip clip;

	public save save;

	private ddload ddload;

	public Color pressed;

	public Color unpressed;

	public setparts setpart;

	public Collider cross;

	public Camera mainCamera;

	public Camera textcam;

	public void Start()
	{
		ddload = (GameObject.Find("ddload(Clone)").GetComponent("ddload") as ddload);
	}

	public void Update()
	{
		if (Input.GetMouseButtonUp(0))
		{
			st();
		}
		if (Input.GetMouseButtonDown(0))
		{
			RaycastHit hitInfo = default(RaycastHit);
			if (Physics.Raycast(mainCamera.ScreenPointToRay(UnityEngine.Input.mousePosition), out hitInfo, 100f) && hitInfo.collider.name == "Cross")
			{
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				cross.GetComponent<Renderer>().material.color = pressed;
				cross.GetComponent<Renderer>().material.SetColor("_SpecColor", pressed);
				setpart.check();
				save.cross();
			}
		}
	}

	public void st()
	{
		cross.GetComponent<Renderer>().material.color = unpressed;
		cross.GetComponent<Renderer>().material.SetColor("_SpecColor", Color.white);
	}

	public void Main()
	{
	}
}
